using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollegeShop.Infrastructure.Entities.Repository;

namespace CollegeShop.Infrastructure.Entities.Entity
{
    public class Salesunitstock : IAccessible<T_Salesunitstock, Salesunitstock>, ILogicEntity<T_Salesunitstock, Salesunitstock>
    {
        public int ID { get; set; }

        public int SalesUnitID { get; set; }

        public int GoodsID { get; set; }

        public int ActualStock { get; set; }

        public int WarningValue { get; set; }

        public int PlanValue { get; set; }

        protected override void Covariant(T_Salesunitstock model)
        {
            if (model != null)
            {
                    this.ID = model.ID;
                    this.SalesUnitID = model.SalesUnitID;
                    this.GoodsID = model.GoodsID;
                    this.ActualStock = model.ActualStock;
                    this.WarningValue = model.WarningValue;
                    this.PlanValue = model.PlanValue;
            }
}
        protected override T_Salesunitstock Inverter(Salesunitstock model)
        {
            if (model != null)
            {
                return new T_Salesunitstock()
                {
                    ID = model.ID,
                    SalesUnitID = model.SalesUnitID,
                    GoodsID = model.GoodsID,
                    ActualStock = model.ActualStock,
                    WarningValue = model.WarningValue,
                    PlanValue = model.PlanValue,
                };
            }
            return null;
        }
        public Salesunitstock Set(T_Salesunitstock dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
